
<div class="layui-header">
    <div class="layui-logo">Smart 后台布局</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
        <li class="layui-nav-item"><a href="index.html">首页</a></li>
        <li class="layui-nav-item"><a href="mail.html">邮件管理</a></li>
        <li class="layui-nav-item"><a href="makeAppointment.html">用户预约</a></li>
        <li class="layui-nav-item"><a href="suggest.html">建议</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
            <a href="javascript:;">
                <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                <span id="name"></span>
            </a>
        </li>
        <li class="layui-nav-item"><a href="/Smart_Backstage/logout.do">退了</a></li>
    </ul>
</div>

<script>

    $.ajax({
        // 编写json格式，设置属性和值
        url: "/Smart_Backstage/user/message",
        contentType: "application/json;charset=UTF-8",
        data: '',
        dataType: "json",
        type: "post",
        success: function (data) {
            if(data!=undefined||data!=null){
                $("#name").html(data.name);
            }
        }
    })



</script>